function queryUrl(key) {
    var search = location.search;
    var data = {};
    if (search) {
        var reg = /(\w+)=([^&]+)/g; // user=a123123
        while (reg.exec(search)) {
            // console.log(RegExp.$1, RegExp.$2);
            data[RegExp.$1] = decodeURIComponent(RegExp.$2);
        }
    }
    if (key) {
        return data[key] === undefined ? "" : data[key];
    } else {
        return data;
    }
}
